package com.yx.fx.webApi.serviceImpl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yx.fx.webApi.entity.TEnterprise;
import com.yx.fx.webApi.mapper.TEnterpriseMapper;
import com.yx.fx.webApi.param.TEnterpriseParam;
import com.yx.fx.webApi.service.TEnterpriseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author pxb
 * @since 2021-09-17
 */
@Service
public class TEnterpriseServiceImpl extends ServiceImpl<TEnterpriseMapper, TEnterprise> implements TEnterpriseService {

    @Autowired
    private TEnterpriseService tEnterpriseService;
    /**
     * 分页
     *
     * @param param 分页条件
     * @return 分页数据
     */
    public IPage<TEnterprise> page(TEnterpriseParam param) {
        System.out.println("1111111111111111");
        System.out.println(param.getCreditNo());
        System.out.println(param.getName());
        IPage<TEnterprise> tEnterpriseIPage = tEnterpriseService.page(new Page<>(param.getCurrent(), param.getSize()),
                new QueryWrapper<TEnterprise>().lambda()
                        .like(StrUtil.isNotBlank(param.getEid()), TEnterprise::getEid, param.getEid())
                        .like(StrUtil.isNotBlank(param.getRegNo()), TEnterprise::getRegNo, param.getRegNo())
                        .like(StrUtil.isNotBlank(param.getCreditNo()), TEnterprise::getCreditNo, param.getCreditNo())
                        .like(StrUtil.isNotBlank(param.getName()), TEnterprise::getName, param.getName())
/*                      .like(StrUtil.isNotBlank(param.getFormatName()), TEnterprise::getFormatName, param.getFormatName())
                        .like(StrUtil.isNotBlank(param.getCategory()), TEnterprise::getCategory, param.getCategory())
                        .like(StrUtil.isNotBlank(param.getProvince()), TEnterprise::getProvince, param.getProvince())
                        .like(StrUtil.isNotBlank(param.getEconKind()), TEnterprise::getEconKind, param.getEconKind())
                        .like(StrUtil.isNotBlank(param.getRegistCapi()), TEnterprise::getRegistCapi, param.getRegistCapi())
                        .like(StrUtil.isNotBlank(param.getActualCapi()), TEnterprise::getActualCapi, param.getActualCapi())
                        .like(StrUtil.isNotBlank(param.getTermStart()), TEnterprise::getTermStart, param.getTermStart())
                        .like(StrUtil.isNotBlank(param.getTermEnd()), TEnterprise::getTermEnd, param.getTermEnd())
                        .like(StrUtil.isNotBlank(param.getCheckDate()), TEnterprise::getCheckDate, param.getCheckDate())
                        .like(StrUtil.isNotBlank(param.getBelongOrg()), TEnterprise::getBelongOrg, param.getBelongOrg())
                        .like(StrUtil.isNotBlank(param.getOperName()), TEnterprise::getOperName, param.getOperName())
                        .like(StrUtil.isNotBlank(param.getOperType()), TEnterprise::getOperType, param.getOperType())
                        .like(StrUtil.isNotBlank(param.getOperNameId()), TEnterprise::getOperNameId, param.getOperNameId())
                        .like(StrUtil.isNotBlank(param.getStartDate()), TEnterprise::getStartDate, param.getStartDate())
                        .like(StrUtil.isNotBlank(param.getEndDate()), TEnterprise::getEndDate, param.getEndDate())
                        .like(StrUtil.isNotBlank(param.getStatus()), TEnterprise::getStatus, param.getStatus())
                        .like(StrUtil.isNotBlank(param.getAddress()), TEnterprise::getAddress, param.getAddress())
                        .like(StrUtil.isNotBlank(String.valueOf(param.getType())), TEnterprise::getType, param.getType())
                        .like(StrUtil.isNotBlank(param.getTypeDesc()), TEnterprise::getTypeDesc, param.getTypeDesc())
                        .like(StrUtil.isNotBlank(param.getTitle()), TEnterprise::getTitle, param.getTitle())
                        .like(StrUtil.isNotBlank(param.getObjId()), TEnterprise::getObjId, param.getObjId())
                        .like(StrUtil.isNotBlank(param.getSource()), TEnterprise::getSource, param.getSource())
                        .like(StrUtil.isNotBlank(param.getTaxNo()), TEnterprise::getTaxNo, param.getTaxNo())
                        .like(StrUtil.isNotBlank(param.getColleguesNum()), TEnterprise::getScope, param.getScope())*/
                        .orderByDesc(TEnterprise::getId));
        return tEnterpriseIPage;
    }



}
